package com.heba.loader;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.heba.greenmulu.R;
import com.youth.banner.loader.ImageLoader;

/**
 * GlideImageLoader
 */
public class DiaryDetailGlideImageLoader extends ImageLoader {

    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {

        RequestOptions options = new RequestOptions()
                .placeholder(R.drawable.btn_upload_image)
                .error(R.drawable.btn_upload_image);

        /**
         * 加载图片
         */
        Glide.with(context)
                .load(path)
                .apply(options)
                .into(imageView);
    }

//    @Override
//    public ImageView createImageView(Context context) {
//        //圆角
//        RoundImageView imageView = new RoundImageView(context);
//        imageView.setBorderRadius(DensityUtils.dip2px(context, 4));
//        imageView.setType(RoundImageView.TYPE_ROUND);
//        return imageView;
//    }
}
